// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** editCommitUser PUT /user */
export async function editCommitUserUsingPUT(
  body: API.EditCommitUserQuery,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/user', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** addCommitUser POST /user */
export async function addCommitUserUsingPOST(
  body: API.AddCommitUserQuery,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/user', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** deleteCommitUser DELETE /user */
export async function deleteCommitUserUsingDELETE(
  body: API.DeleteCommitUserQuery,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/user', {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getCurrentUser POST /user/current */
export async function getCurrentUserUsingPOST(options?: { [key: string]: any }) {
  return request<API.BaseResponseCommitUserDTO_>('/user/current', {
    method: 'POST',
    ...(options || {}),
  });
}

/** editUserPassword POST /user/editPassword */
export async function editUserPasswordUsingPOST(
  body: API.EditUserPasswordQuery,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/user/editPassword', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** getById GET /user/getById */
export async function getByIdUsingGET(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseCommitUserDTO_>('/user/getById', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** listCommitUser GET /user/list */
export async function listCommitUserUsingGET(options?: { [key: string]: any }) {
  return request<API.BaseResponseListCommitUserDTO_>('/user/list', {
    method: 'GET',
    ...(options || {}),
  });
}

/** userLogin POST /user/login */
export async function userLoginUsingPOST(
  body: API.UserLoginQuery,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean_>('/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** userLogout POST /user/logout */
export async function userLogoutUsingPOST(options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean_>('/user/logout', {
    method: 'POST',
    ...(options || {}),
  });
}
